package com.ruoyi.submit.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.submit.mapper.TQuestionSubmitMapper;
import com.ruoyi.submit.domain.TQuestionSubmit;
import com.ruoyi.submit.service.ITQuestionSubmitService;

/**
 * 题目提交Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-10-18
 */
@Service
public class TQuestionSubmitServiceImpl implements ITQuestionSubmitService 
{
    @Autowired
    private TQuestionSubmitMapper tQuestionSubmitMapper;

    /**
     * 查询题目提交
     * 
     * @param id 题目提交主键
     * @return 题目提交
     */
    @Override
    public TQuestionSubmit selectTQuestionSubmitById(Long id)
    {
        return tQuestionSubmitMapper.selectTQuestionSubmitById(id);
    }

    /**
     * 查询题目提交列表
     * 
     * @param tQuestionSubmit 题目提交
     * @return 题目提交
     */
    @Override
    public List<TQuestionSubmit> selectTQuestionSubmitList(TQuestionSubmit tQuestionSubmit)
    {
        return tQuestionSubmitMapper.selectTQuestionSubmitList(tQuestionSubmit);
    }

    /**
     * 新增题目提交
     * 
     * @param tQuestionSubmit 题目提交
     * @return 结果
     */
    @Override
    public int insertTQuestionSubmit(TQuestionSubmit tQuestionSubmit)
    {
        tQuestionSubmit.setCreateTime(DateUtils.getNowDate());
        return tQuestionSubmitMapper.insertTQuestionSubmit(tQuestionSubmit);
    }

    /**
     * 修改题目提交
     * 
     * @param tQuestionSubmit 题目提交
     * @return 结果
     */
    @Override
    public int updateTQuestionSubmit(TQuestionSubmit tQuestionSubmit)
    {
        tQuestionSubmit.setUpdateTime(DateUtils.getNowDate());
        return tQuestionSubmitMapper.updateTQuestionSubmit(tQuestionSubmit);
    }

    /**
     * 批量删除题目提交
     * 
     * @param ids 需要删除的题目提交主键
     * @return 结果
     */
    @Override
    public int deleteTQuestionSubmitByIds(Long[] ids)
    {
        return tQuestionSubmitMapper.deleteTQuestionSubmitByIds(ids);
    }

    /**
     * 删除题目提交信息
     * 
     * @param id 题目提交主键
     * @return 结果
     */
    @Override
    public int deleteTQuestionSubmitById(Long id)
    {
        return tQuestionSubmitMapper.deleteTQuestionSubmitById(id);
    }
}
